<HTML><HEAD><TITLE>current_domain(?Name, -DefModule, -DomainDef)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Comparing and Sorting</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>current_domain(?Name, -DefModule, -DomainDef)</H1>
Name is the name of a visible domain, defined by DomainDef in DefModule
<DL>
<DT><EM>Name</EM></DT>
<DD>Atom or variable
</DD>
<DT><EM>DefModule</EM></DT>
<DD>Variable or atom (module)
</DD>
<DT><EM>DomainDef</EM></DT>
<DD>Usually variable, will be bound to a ground structure
</DD>
</DL>
<H2>Description</H2>
<P>
	Used to look up a domain definition, or to enumerate all domain
	definitions visible in the caller module. Visible domain definitions
	are those which have been either declared locally, or exported,
	or which have been imported or reexported from another module.
	</P><P>
	DefModule is the module where the domain was declared local or
	exported. DomainDef is the structure which was specified in the
	original domain definition.
	</P>

<H3>Modes and Determinism</H3><UL>
<LI>current_domain(+, -, -) is semidet
<LI>current_domain(-, -, -) is nondet
</UL>
<H3>Modules</H3>
This predicate is sensitive to its module context (tool predicate, see @/2).
<H3>Fail Conditions</H3>
No visible domain name unifies with Name
<H2>Examples</H2>
<PRE>
    :- local domain(colour(red,green,blue)).

    :- export domain(vowel(a,e,i,o,u)).

    :- local domain(abc(a,b,c)).
    Domain value a not unique in module eclipse
    out of range in local domain(abc(a, b, c))
    Abort

    ?- current_domain(Name, DefModule, Def).
    Name = colour
    DefModule = eclipse
    Def = colour(red, green, blue)
    More (0.00s cpu) ? ;

    Name = vowel
    DefModule = eclipse
    Def = vowel(a, e, i, o, u)
    More (0.00s cpu) ? ;

    No (0.00s cpu)

    ?- current_domain(vowel, DefModule, Def).
    Name = vowel
    DefModule = eclipse
    Def = vowel(a, e, i, o, u)
    Yes (0.00s cpu)

    ?- current_domain(abc, DefModule, Def).
    No (0.00s cpu)
    </PRE>
<H2>See Also</H2>
<A HREF="../../kernel/termcomp/domain-1.html">domain / 1</A>, <A HREF="../../kernel/termcomp/domain_index-3.html">domain_index / 3</A>
</BODY></HTML>
